def is_palindrome(n):
	n = str(n)
	return n==n[::-1]

def binstr(n):
	return bin(n)[2:]

lf = filter(lambda x:is_palindrome(x) and is_palindrome(binstr(x)), l)

print(sum(lf))
